<script setup>
import { ref, computed } from 'vue';
// 定义全部成绩列表
const scoreList = ref([80,100,90,70,60])
// 计算属性, 优秀成绩列表
const betterScore = computed(() => {
  return scoreList.value.filter(score => score >= 90)
})
// 添加成绩函数
const addScore = () => {
  scoreList.value.push(60,90)
}
</script>

<template>
  <div>
    全部的成绩: {{scoreList}}
    <button @click="addScore">添加成绩</button>
  </div>
  <div>
    优秀成绩: {{ betterScore }}
  </div>
</template>

<style lang="scss" scoped></style>
